package at.ac.univie.zsu.aguataplan.domain;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

/**
 * @author gerry
 * 
 */
@Entity
public class EventAttributeValuePlayer extends EventAttributeValue {

	@ManyToOne
	private Player refPlayer;

	// ----------------------------------------------------
	// CONSTRUCTOR
	// ----------------------------------------------------

	public EventAttributeValuePlayer() {

	}

	// ----------------------------------------------------
	// COMPARABLE
	// ----------------------------------------------------

	@Override
	public int compareTo(EventAttributeValue o) {
		// TODO: add compareTo statement
		return -1;
	}

	// ----------------------------------------------------
	// METHODS
	// ----------------------------------------------------

	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("Id: ").append(getId()).append(", ");
		sb.append("RefAttribute: ").append(getRefEventAttribute() == null ? "null" : getRefEventAttribute().size())
				.append(", ");
		sb.append("RefDetectedEvent: ").append(getRefDetectedEvent()).append(", ");
		sb.append("RefPlayer: ").append(getRefPlayer()).append(", ");
		sb.append("Version: ").append(getVersion());
		return sb.toString();
	}

	// ----------------------------------------------------
	// GETTER & SETTER
	// ----------------------------------------------------

	public Player getRefPlayer() {
		return refPlayer;
	}

	public void setRefPlayer(Player refPlayer) {
		this.refPlayer = refPlayer;
	}

}
